<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
      <el-form-item label="车号" prop="chehao">
        <el-input v-model="queryParams.chehao" placeholder="请输入车号 " clearable @keyup.enter.native="handleQuery" />
      </el-form-item>



      <el-form-item label="称重编号" prop="czbh">
        <el-input v-model="queryParams.xcbm" placeholder="请输入称重编号 " clearable @keyup.enter.native="handleQuery" />
      </el-form-item>

      <el-form-item label="卡号" prop="card_id">
        <el-input v-model="queryParams.xcbm" placeholder="请输入订单编号 " clearable @keyup.enter.native="handleQuery" />
      </el-form-item>


      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <!-- <el-col :span="1.5">
        <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
          v-hasPermi="['system:guozhong:export']">导出</el-button>
      </el-col> -->
      <el-col :span="1.5">
        <el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate"
<<<<<<< HEAD
          v-hasPermi="['system:merge:list']">首次录入信息</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="single" @click="handleDelete"
          v-hasPermi="['system:merge:list']">非首次录入</el-button>
=======
          v-hasPermi="['system:merge:xinxi1']">首次录入信息</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="single" @click="handleDelete"
          v-hasPermi="['system:merge:remove']">非首次录入</el-button>
>>>>>>> b4a0e2dba4b1f1e0b05e6d155df4272830d06f27
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>
    <!-- v-loading="loading" -->
    <el-table v-loading="loading" :data="guozhongList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" align="center" />
      <el-table-column label="订单编号" width="200" align="center" prop="ddbh" />
      <el-table-column label="称重编号" width="200" align="center" prop="czbh" />
      <el-table-column label="卡号" width="200" align="center" prop="card_id" />
      <el-table-column label="车号" width="150" align="center" prop="chehao" />
      <el-table-column label="物料名" width="200" align="center" prop="wlmc" />
      <el-table-column label="进厂时间" align="center" prop="mzsj" />
      <el-table-column label="出厂时间" align="center" prop="pzsj" />
      <el-table-column label="进厂地磅" align="center" prop="dbh" />
      <el-table-column label="过磅状态" align="center" prop="gbzt" />
      <el-table-column label="内外销" align="center" prop="sd_dwx" />
      <el-table-column label="包装物名" align="center" prop="sd_bzwmc" />
    </el-table>

    <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
      @pagination="getList" />




    <!-- 录入多交货单 -->
    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-form-item label=" " prop="gid">
          <el-input v-model="form.gid" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="ddbh">
          <el-input v-model="form.ddbh" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="cardId">
          <el-input v-model="form.cardId" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="chehao">
          <el-input v-model="form.chehao" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="wlmcc">
          <el-input v-model="form.wlmcc" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="gysbh">
          <el-input v-model="form.gysbh" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="gysdm">
          <el-input v-model="form.gysdm" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="gsmc">
          <el-input v-model="form.gsmc" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="gsbh">
          <el-input v-model="form.gsbh" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="wlbh">
          <el-input v-model="form.wlbh" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="wlmc">
          <el-input v-model="form.wlmc" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="ckbh">
          <el-input v-model="form.ckbh" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="ckmc">
          <el-input v-model="form.ckmc" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="khbh">
          <el-input v-model="form.khbh" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="songdf">
          <el-input v-model="form.songdf" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label=" " prop="sdfbh">
          <el-input v-model="form.sdfbh" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="shoudf">
          <el-input v-model="form.shoudf" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="jhxm">
          <el-input v-model="form.jhxm" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="jlscbz">
          <el-input v-model="form.jlscbz" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="yhckrxm">
          <el-input v-model="form.yhckrxm" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="yhkh">
          <el-input v-model="form.yhkh" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="lxdh">
          <el-input v-model="form.lxdh" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="fpbh">
          <el-input v-model="form.fpbh" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="fpshr">
          <el-input v-model="form.fpshr" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="fpscsfzh">
          <el-input v-model="form.fpscsfzh" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="fpsccgbz">
          <el-input v-model="form.fpsccgbz" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="gblx">
          <el-input v-model="form.gblx" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="gbzt">
          <el-input v-model="form.gbzt" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="hytb">
          <el-input v-model="form.hytb" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="sgtm">
          <el-input v-model="form.sgtm" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="sby">
          <el-input v-model="form.sby" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="xhry">
          <el-input v-model="form.xhry" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="yj">
          <el-input v-model="form.yj" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="tplj">
          <el-input v-model="form.tplj" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label=" " prop="ddxmbh">
          <el-input v-model="form.ddxmbh" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="zczm">
          <el-input v-model="form.zczm" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label=" " prop="zczmtp">
          <el-input v-model="form.zczmtp" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label=" " prop="shsfzh">
          <el-input v-model="form.shsfzh" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="ddlx">
          <el-input v-model="form.ddlx" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="zcks">
          <el-input v-model="form.zcks" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="zcmz">
          <el-input v-model="form.zcmz" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="sjxm">
          <el-input v-model="form.sjxm" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="sjdh">
          <el-input v-model="form.sjdh" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="sjsfz">
          <el-input v-model="form.sjsfz" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="ymqybsm">
          <el-input v-model="form.ymqybsm" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="ymsbm">
          <el-input v-model="form.ymsbm" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="ymsbmdy">
          <el-input v-model="form.ymsbmdy" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="xcp">
          <el-input v-model="form.xcp" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="xcpdy">
          <el-input v-model="form.xcpdy" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="zcp">
          <el-input v-model="form.zcp" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="zcpdy">
          <el-input v-model="form.zcpdy" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="hyd">
          <el-input v-model="form.hyd" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="hyddy">
          <el-input v-model="form.hyddy" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="cmz">
          <el-input v-model="form.cmz" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="cmzdy">
          <el-input v-model="form.cmzdy" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="xcbm">
          <el-input v-model="form.xcbm" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="zjshbs">
          <el-input v-model="form.zjshbs" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="shfpbh">
          <el-input v-model="form.shfpbh" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="shfpbhdy">
          <el-input v-model="form.shfpbhdy" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="ddwlsl">
          <el-input v-model="form.ddwlsl" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="rkgbd">
          <el-input v-model="form.rkgbd" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="rkgbddy">
          <el-input v-model="form.rkgbddy" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="ckgbd">
          <el-input v-model="form.ckgbd" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="ckgbddy">
          <el-input v-model="form.ckgbddy" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="ddysdh">
          <el-input v-model="form.ddysdh" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="ddyszl">
          <el-input v-model="form.ddyszl" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="dbh">
          <el-input v-model="form.dbh" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="dbh2">
          <el-input v-model="form.dbh2" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="czymc">
          <el-input v-model="form.czymc" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="czymc2">
          <el-input v-model="form.czymc2" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="nlmtbz1">
          <el-input v-model="form.nlmtbz1" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="nlmtbz2">
          <el-input v-model="form.nlmtbz2" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="qyry">
          <el-input v-model="form.qyry" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="jlscsbcs">
          <el-input v-model="form.jlscsbcs" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="jshth">
          <el-input v-model="form.jshth" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="fpscsbcs">
          <el-input v-model="form.fpscsbcs" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="fpscfhwb">
          <el-input v-model="form.fpscfhwb" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label="潮粮/干粮" prop="orclgl">
          <el-input v-model="form.orclgl" placeholder="请输入潮粮/干粮" />
        </el-form-item>
        <el-form-item label=" " prop="hysqgch">
          <el-input v-model="form.hysqgch" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="ddbdcs">
          <el-input v-model="form.ddbdcs" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label="规格" prop="guige">
          <el-input v-model="form.guige" placeholder="请输入规格" />
        </el-form-item>
        <el-form-item label=" " prop="sapbzsc">
          <el-input v-model="form.sapbzsc" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="fzfs">
          <el-input v-model="form.fzfs" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="zds">
          <el-input v-model="form.zds" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="zzysdw">
          <el-input v-model="form.zzysdw" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="yfrq">
          <el-input v-model="form.yfrq" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="yfk">
          <el-input v-model="form.yfk" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="bzxx">
          <el-input v-model="form.bzxx" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="dzymkz">
          <el-input v-model="form.dzymkz" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="yslx">
          <el-input v-model="form.yslx" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="ershisibz">
          <el-input v-model="form.ershisibz" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="ycJzcc">
          <el-input v-model="form.ycJzcc" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="ycCcc">
          <el-input v-model="form.ycCcc" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="jctuCp">
          <el-input v-model="form.jctuCp" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label=" " prop="jctuHk">
          <el-input v-model="form.jctuHk" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label=" " prop="cctuCp">
          <el-input v-model="form.cctuCp" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label=" " prop="cctuHk">
          <el-input v-model="form.cctuHk" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label=" " prop="bz">
          <el-input v-model="form.bz" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="czqztc">
          <el-input v-model="form.czqztc" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="lscp">
          <el-input v-model="form.lscp" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="lscpBj">
          <el-input v-model="form.lscpBj" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="ddysmz">
          <el-input v-model="form.ddysmz" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="ddysjz">
          <el-input v-model="form.ddysjz" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="ysjzBj">
          <el-input v-model="form.ysjzBj" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="fkZdr">
          <el-input v-model="form.fkZdr" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="sdDwx">
          <el-input v-model="form.sdDwx" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="sdBzwmc">
          <el-input v-model="form.sdBzwmc" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="fwZdz">
          <el-input v-model="form.fwZdz" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="fwZgz">
          <el-input v-model="form.fwZgz" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="fwNwx">
          <el-input v-model="form.fwNwx" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="fwBzwm">
          <el-input v-model="form.fwBzwm" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="kkRjbb">
          <el-input v-model="form.kkRjbb" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="gbRjbb">
          <el-input v-model="form.gbRjbb" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="clFbbz">
          <el-input v-model="form.clFbbz" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="htYcclYcKg">
          <el-input v-model="form.htYcclYcKg" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="ysmzBj">
          <el-input v-model="form.ysmzBj" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="upsapbs">
          <el-input v-model="form.upsapbs" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="zzmtbs">
          <el-input v-model="form.zzmtbs" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="thirdCompany">
          <el-input v-model="form.thirdCompany" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="photoSfz">
          <el-input v-model="form.photoSfz" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label=" " prop="yhzhsfzh">
          <el-input v-model="form.yhzhsfzh" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="fpph">
          <el-input v-model="form.fpph" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="hzddybs">
          <el-input v-model="form.hzddybs" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="chexc">
          <el-input v-model="form.chexc" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="zhuanchangbiaoji">
          <el-input v-model="form.zhuanchangbiaoji" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="zhuanchangcishu">
          <el-input v-model="form.zhuanchangcishu" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="photoCkqr">
          <el-input v-model="form.photoCkqr" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="photoZxcqr">
          <el-input v-model="form.photoZxcqr" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="qymc">
          <el-input v-model="form.qymc" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="khyh">
          <el-input v-model="form.khyh" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="yshdwmc">
          <el-input v-model="form.yshdwmc" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="zzjgdm">
          <el-input v-model="form.zzjgdm" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label=" " prop="sllx">
          <el-input v-model="form.sllx" placeholder="请输入 " />
        </el-form-item>
        <el-form-item label="委托付款协议照片" prop="photoWtxy">
          <el-input v-model="form.photoWtxy" placeholder="请输入委托付款协议照片" />
        </el-form-item>
        <el-form-item label="自产证明" prop="photoZczm">
          <el-input v-model="form.photoZczm" placeholder="请输入自产证明" />
        </el-form-item>
        <el-form-item label="承包土地合同" prop="photoCbtdht">
          <el-input v-model="form.photoCbtdht" placeholder="请输入承包土地合同" />
        </el-form-item>
        <el-form-item label="状态" prop="photoZt">
          <el-input v-model="form.photoZt" placeholder="请输入状态" />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import { listMergeGuozhong } from "@/api/system/Fdongbei/merge";

export default {
  name: "Guozhong",
  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 子表选中数据
      checkedTbHuayan: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // tb表格数据
      guozhongList: [],
      // 化验--》表格数据
      tbHuayanList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        beginTime: null,
        endTime: null,
        chehao: null,
        wlmc: null,
        ckbh: null,
        xcbm: null,
        czbh: null,
        ddbh: null,
        yj: null,
        bj: null,
      },
      dateRange: this.timeDefault(),
      dropCar: null,
      selectedValue: null,
      // 表单参数
      form: {},
      // 表单校验
      rules: {
        beginTime: [{ required: true, message: " 不能为空", trigger: "blur" }],
        endTime: [{ required: true, message: " 不能为空", trigger: "blur" }],
      },
    };
  },
  created() {
    this.getList();
  },
  methods: {
    //设置默认时间

    // 默认时间
    timeDefault() {
      let date = new Date();

      // 通过时间戳计算
      let defalutStartTime = date.getTime() - 7 * 24 * 3600 * 1000; // 转化为时间戳
      let defalutEndTime = date.getTime();

      let startDateNs = new Date(defalutStartTime);
      let endDateNs = new Date(defalutEndTime);

      // 月，日，时，分，秒 不够10补0
      defalutStartTime =
        startDateNs.getFullYear() +
        "-" +
        (startDateNs.getMonth() + 1 >= 10
          ? startDateNs.getMonth() + 1
          : "0" + (startDateNs.getMonth() + 1)) +
        "-" +
        (startDateNs.getDate() >= 10
          ? startDateNs.getDate()
          : "0" + startDateNs.getDate()) +
        " " +
        (startDateNs.getHours() >= 10
          ? startDateNs.getHours()
          : "0" + startDateNs.getHours()) +
        ":" +
        (startDateNs.getMinutes() >= 10
          ? startDateNs.getMinutes()
          : "0" + startDateNs.getMinutes()) +
        ":" +
        (startDateNs.getSeconds() >= 10
          ? startDateNs.getSeconds()
          : "0" + startDateNs.getSeconds());

      defalutEndTime =
        endDateNs.getFullYear() +
        "-" +
        (endDateNs.getMonth() + 1 >= 10
          ? endDateNs.getMonth() + 1
          : "0" + (endDateNs.getMonth() + 1)) +
        "-" +
        (endDateNs.getDate() >= 10
          ? endDateNs.getDate()
          : "0" + endDateNs.getDate()) +
        " " +
        (endDateNs.getHours() >= 10
          ? endDateNs.getHours()
          : "0" + endDateNs.getHours()) +
        ":" +
        (endDateNs.getMinutes() >= 10
          ? endDateNs.getMinutes()
          : "0" + endDateNs.getMinutes()) +
        ":" +
        (endDateNs.getSeconds() >= 10
          ? endDateNs.getSeconds()
          : "0" + endDateNs.getSeconds());

      return [defalutStartTime, defalutEndTime];
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },

    /** 多交货单添加 */
    handleUpdate(row) {
      this.reset();
      const czbh = row.czbh || this.ids
      getGuozhong(czbh).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "修改tb";
      });
    },
    /** 查询tb列表 */
    getList() {
      this.loading = true;
      listMergeGuozhong(this.queryParams).then((response) => {
        const json = JSON.stringify(response);
        console.log(json + "<------");

        this.guozhongList = response.rows;

        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        czbh: "",
        chehao: "",
        gysdm: "",
        ckbh: "",
        xcbm: "",
        yj: null,
      };
      this.resetForm("form");
    },

    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    handleSelectionChange(selection) {
      this.ids = selection.map((item) => item.czbh);
      this.single = selection.length !== 1;
      this.multiple = !selection.length;
    },

    /** 导出按钮操作 */
    handleExport() {
      this.download(
        "system/guozhong/export",
        {
          ...this.queryParams,
        },
        `guozhong_${new Date().getTime()}.xlsx`
      );
    },
  },
};
</script>